package com.bcinfo.iccard.busi;

import java.util.Map;

/**
 * 业务处理工厂
 * @author wangguangchun
 *
 */
public class BusinessHandlerFactory {
	
	private Map<Integer,BusinessHandler> handlers;
	/**
	 *根据业务类型返回业务处理bean 
	 * @param busType 业务类型
	 * @return
	 */
	public BusinessHandler getHandler(Integer busType){
		return handlers.get(busType);
	}
	public Map<Integer, BusinessHandler> getHandlers() {
		return handlers;
	}
	public void setHandlers(Map<Integer, BusinessHandler> handlers) {
		this.handlers = handlers;
	}
	/**
	 * 判断是否存在对应的处理类
	 * @param busType 业务类型
	 * @return
	 */
	public boolean hasHandler(Integer busType){
		return handlers.containsKey(busType);
	}
	
}
